﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Exdot
{
    public partial class FrmTK_TN : Form
    {
        public List<ThuNhap> result = null;
        public FrmTK_TN()
        {
            InitializeComponent();
        }

        private void btnTim_Click(object sender, EventArgs e)
        {
            if (txtTenCT.Text == "")
            {
                MessageBox.Show("Nhap tu khoa can tim");
            }
            else
            {
                using (var context = new QuanLyChiTieuEntities())
                {
                    result = (from a in context.ThuNhaps where a.TenTN.Contains(txtTenCT.Text) && a.ThoiGian.Year==dtpNgayTN.Value.Year&&a.ThoiGian.Month==dtpNgayTN.Value.Month&&a.ThoiGian.Day==dtpNgayTN.Value.Day select a).ToList<ThuNhap>();
                }
                this.Close();
            }
        }
    }
}
